package com.ymatou.iapi.marketingmanage.testcase;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.Map;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.google.gson.JsonObject;
import com.ymatou.iapi.marketingmanage.parameter.CreateSellerPromotionBean;
import com.ymatou.iapi.marketingmanage.parameter.PromotionPolicy;
import com.ymatou.iapi.marketingmanage.parameter.PromotionValue;
import com.ymatou.iapi.marketingmanage.service.CreateSellerPromotionCall;
import com.ymatou.iapi.trading.operate.parameter.enums.PromotionTypeEnum;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.*;
import com.ymt.utils.tag.*;
import com.ymttest.business.service.JSellerPromotionCallService;
import com.ymttest.database.mongo.NewSellerPromotionInfoWapper;
import com.ymttest.database.mongo.YmtBuyerProductWapper;
import com.ymttest.utils.TestDataManager;
import com.ymttest.utils.YMTDateUtil;

/**
 * 创建促销活动 FreeMaker Template自动生成代码 接口
 * http://wiki.ymatou.cn:8090/pages/viewpage.action?pageId=22130076 db
 * http://wiki.ymatou.cn:8090/pages/viewpage.action?pageId=22129111
 */
@TestSuite
public class Ts_CreateSellerPromotion {
	private static CreateSellerPromotionBean createsellerpromotionBean;
	private static CreateSellerPromotionCall createsellerpromotionCall;

	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("创建促销活动");
	}

	@Before
	public void caseUp() {
		createsellerpromotionBean = new CreateSellerPromotionBean();
		createsellerpromotionCall = new CreateSellerPromotionCall();
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(createsellerpromotionCall.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}

	/**
	 * @param sellerid
	 * @return
	 */
	private CreateSellerPromotionBean initCreateSellerPromotionBean(int sellerid, PromotionTypeEnum promotionType) {
		CreateSellerPromotionBean cspb = new CreateSellerPromotionBean();
		cspb.setSellerId(sellerid);
		PromotionPolicy PromotionInfo = new PromotionPolicy();
		PromotionInfo.setCanUseSellerCoupon(false);
		PromotionInfo.setIsLimitProduct(false);
		PromotionInfo.setIsSameProductUse(false);
		PromotionInfo.setIsSpecifyProduct(false);
		PromotionInfo.setProductIds(null);
		PromotionInfo.setPromotionBeginTime(YMTDateUtil.getBeforeOrNextDay(0, YMTDateUtil.YMDTHMS_STRING));
		PromotionInfo.setPromotionDesc(sellerid + ":满减描述" + TestDataManager.getRandomUUID().toString());
		PromotionInfo.setPromotionEndTime(YMTDateUtil.getBeforeOrNextDay(1, YMTDateUtil.YMDTHMS_STRING));
		PromotionInfo.setPromotionName(sellerid + ":满减活动PN");
		PromotionInfo.setPromotionType(promotionType.getCode());
		List<PromotionValue> PromotionValues = new ArrayList<>();
		PromotionInfo.setPromotionValues(PromotionValues);
		List<String> ProductId = new ArrayList<>();
		PromotionInfo.setProductIds(ProductId);
		cspb.setPromotionInfo(PromotionInfo);
		return cspb;
	}

	private void addPromotionValue(CreateSellerPromotionBean cspb, String rv, String dv) {
		PromotionValue e = new PromotionValue();
		if (cspb.getPromotionInfo().getPromotionType() == 3 || cspb.getPromotionInfo().getPromotionType() == 4) {
			if (rv != null) {
				e.setAmountCondition(new BigDecimal(rv));
			}
			e.setValue(new BigDecimal(dv));
		} else {
			if (rv != null) {
				e.setQtyCondition(Integer.valueOf(rv));
			}
			e.setValue(new BigDecimal(dv));
		}
		cspb.getPromotionInfo().getPromotionValues().add(e);
	}

	private void verifyDB(Integer promotionId, CreateSellerPromotionBean createsellerpromotionBean2) throws Exception {
		Map m = new NewSellerPromotionInfoWapper().getPromotionById(promotionId);
		// {_id=82, sid=1, name=1:满减活动PN,
		// des=1:满减描述dac1f1e7-d945-43da-892e-533af7d81478, bt=Sat May 27
		// 10:52:49 CST 2017, et=Sun May 28 10:51:59 CST 2017, type=1, ct=Sat
		// May 27 10:52:49 CST 2017, ut=Sat May 27 10:52:49 CST 2017,
		// isuc=false, issp=false, pjm=1, isend=false, vs=[ { "rv" : "0" , "dv"
		// : "1"}]}
		// {"SellerId":1,"PromotionInfo":{"PromotionName":"1:满减活动PN","PromotionDesc":"1:满减描述dac1f1e7-d945-43da-892e-533af7d81478","PromotionBeginTime":"2017-05-27T10:51:48","PromotionEndTime":"2017-05-28T10:51:48","PromotionType":1,"CanUseSellerCoupon":false,"IsSameProductUse":false,"IsSpecifyProduct":false,"IsLimitProduct":false,"PromotionValues":[{"QtyCondition":5,"AmountCondition":5,"Value":1}]}}
		if (m != null && m.get("sid") != null) {
			Logger.verifyEquals(createsellerpromotionBean2.getSellerId(), m.get("sid"), "验证SellerId");
			Logger.verifyEquals(createsellerpromotionBean2.getPromotionInfo().getPromotionName(), m.get("name"), "验证name");
			Logger.verifyEquals(createsellerpromotionBean2.getPromotionInfo().getPromotionDesc(), m.get("des"), "验证des");
			if (createsellerpromotionBean2.getPromotionInfo().getPromotionBeginTime().compareTo(YMTDateUtil.getBeforeOrNextDay(0, YMTDateUtil.YMDTHMS_STRING)) > 0) {
				Logger.verifyEquals(createsellerpromotionBean2.getPromotionInfo().getPromotionBeginTime().substring(0, 16),
						YMTDateUtil.getFromDTSDate(m.get("bt").toString(), YMTDateUtil.YMDTHMS_STRING).substring(0, 16), "验证bt");
			} else {
				Logger.verifyNotNull(YMTDateUtil.getFromDTSDate(m.get("bt").toString(), YMTDateUtil.YMDTHMS_STRING), "验证bt");
			}

			Logger.verifyEquals(createsellerpromotionBean2.getPromotionInfo().getPromotionEndTime().substring(0, 16),
					YMTDateUtil.getFromDTSDate(m.get("et").toString(), YMTDateUtil.YMDTHMS_STRING).substring(0, 16), "验证et");
			Logger.verifyEquals(createsellerpromotionBean2.getPromotionInfo().getIsSameProductUse(), m.get("issp"), "验证issameproduct");
			Logger.verifyEquals(createsellerpromotionBean2.getPromotionInfo().getCanUseSellerCoupon(), m.get("isuc"), "验证isusecoupon");
			Logger.verifyEquals(createsellerpromotionBean2.getPromotionInfo().getPromotionType(), m.get("type"), "验证type");
			Integer type = createsellerpromotionBean2.getPromotionInfo().getPromotionType();
			int mytype = 0;
			if (PromotionTypeEnum.HalfIfCountEnough.getCode() == type || PromotionTypeEnum.DiscountIfCountEnough.getCode() == type
					|| PromotionTypeEnum.ReduceIfCountEnough.getCode() == type) {
				// 满件
				Logger.debug("满件活动");
				mytype = 1;
			} else {
				// 满额
				Logger.debug("满额活动");
				mytype = 2;
			}
			// 排除

			boolean isLimitProduct = createsellerpromotionBean2.getPromotionInfo().getIsLimitProduct();
			// 指定
			boolean isSpecifyProduct = createsellerpromotionBean2.getPromotionInfo().getIsSpecifyProduct();
			// 1：全场商品 2：指定商品 3：排除商品
			if (isLimitProduct == false && isSpecifyProduct == false) {
				Logger.verifyEquals(1, m.get("pjm"), "验证pjm");
			} else if (isLimitProduct == true && isSpecifyProduct == false) {
				Logger.verifyEquals(3, m.get("pjm"), "验证pjm");
			} else if (isLimitProduct == false && isSpecifyProduct == true) {
				Logger.verifyEquals(2, m.get("pjm"), "验证pjm");
			}
			// 未操作
			Logger.verifyEquals(0, m.get("em"), "验证em");
			List<Map> lm = (List<Map>) m.get("vs");

			List<PromotionValue> pvl = createsellerpromotionBean2.getPromotionInfo().getPromotionValues();
			Logger.verifyEquals(lm.size(), pvl.size(), "验证PromotionValueSize");
			// //单个验证 特例
			verifyPromotionValue(type, lm.get(0), pvl.get(0));

			// 多个验证
			for (PromotionValue promotionValue : pvl) {
				if (type == 1) {
					int s = promotionValue.getQtyCondition();
					BigDecimal v = promotionValue.getValue();
					for (Map tm : lm) {
						if (s == Integer.valueOf(tm.get("rv").toString())) {
							verifyPromotionValue(type, tm, promotionValue);
						}
						;
					}
				} else if (mytype == 2) {
					BigDecimal s = promotionValue.getAmountCondition();
					BigDecimal v = promotionValue.getValue();
					for (Map tm : lm) {
						if (s.equals(new BigDecimal(tm.get("rv").toString()))) {
							verifyPromotionValue(type, tm, promotionValue);
						}
						;
					}
				}
			}
			List<Map> psm = (List<Map>) m.get("ps");
			if (psm != null) {
				for (Map map : psm) {
					Logger.verifyNotNull(map.get("pidg"), "验证pidg");
					Logger.verifyNotNull(map.get("pidn"), "验证pidn");
					Logger.verifyNotEquals(0,map.get("pidn"), "验证pidn非0");
				}
				List<String> temppids = createsellerpromotionBean2.getPromotionInfo().getProductIds();
				List<String> pids=new ArrayList<>();
				for (String string : temppids) {
					if(!pids.contains(string)){
						pids.add(string);
					}
				}
				Logger.verifyEquals(pids.size(), psm.size(), "验证PromotionValueSize");
				for (String pid : pids) {
					Logger.verifyIsContains(pid, psm.toString(), "验证包含pid");
				}
			}
		}
	}

	/**
	 * 验证单独的一个PromotionValue
	 * 
	 * @param type
	 * @param m
	 * @param pv1
	 */
	private void verifyPromotionValue(int type, Map m, PromotionValue pv1) {
		if (type == 1) {
			Logger.verifyEquals(pv1.getQtyCondition().toString(), m.get("rv").toString(), "验证rv");
			Logger.verifyEquals(pv1.getValue(), new BigDecimal(m.get("dv").toString()), "验证dv");

		}
		// 折扣的时候/10
		else if (type == 2) {
			Logger.verifyEquals(pv1.getQtyCondition().toString(), m.get("rv").toString(), "验证rv");
			Logger.verifyEquals(pv1.getValue().divide(BigDecimal.valueOf(10)), new BigDecimal(m.get("dv").toString()), "验证dv");

		} else if (type == 3) {
			Logger.verifyEquals(pv1.getAmountCondition(), new BigDecimal(m.get("rv").toString()), "验证rv");
			Logger.verifyEquals(pv1.getValue(), new BigDecimal(m.get("dv").toString()), "验证dv");
		} else if (type == 4) {
			Logger.verifyEquals(pv1.getAmountCondition(), new BigDecimal(m.get("rv").toString()), "验证rv");
			Logger.verifyEquals(pv1.getValue().divide(BigDecimal.valueOf(10)), new BigDecimal(m.get("dv").toString()), "验证dv");

		} else if (type == 5) {
			Logger.verifyEquals("2", m.get("rv").toString(), "验证rv");
			Logger.verifyEquals(new BigDecimal(0.5), new BigDecimal(m.get("dv").toString()), "验证dv");

		}
	}

	@Test
	@Category({ P2.class })
	@TestCase
	public void Tc_CreateSellerPromotion_001() {
		Logger.start(true, "创建满件减PromotionType1促销活动成功");
		try {
			JSellerPromotionCallService.CancelOrEndPromotion(1);
			createsellerpromotionBean = initCreateSellerPromotionBean(1, PromotionTypeEnum.ReduceIfCountEnough);
			addPromotionValue(createsellerpromotionBean, "1", "2");
			createsellerpromotionCall.setData(createsellerpromotionBean);
			createsellerpromotionCall.callService();
			Logger.verifyEquals("操作成功", createsellerpromotionCall.getString("Msg"), "验证Msg");
			Logger.verifyEquals("200", createsellerpromotionCall.getString("Code"), "验证Code");
			Logger.verifyEquals("0", createsellerpromotionCall.getString("BCode"), "验证BCode");
			JsonObject json = createsellerpromotionCall.getJsonObject().getAsJsonObject("Data");
			Logger.verifyEquals(true, json.get("IsSuccess").getAsBoolean(), "验证IsSuccess");
			Logger.verifyEquals("无冲突满减促销", json.get("Msg").getAsString(), "验证Data.Msg");
			Integer PromotionId = json.get("PromotionId").getAsInt();
			verifyDB(PromotionId, createsellerpromotionBean);

			// 取消活动
			if (PromotionId == -1) {
				JSellerPromotionCallService.CancelOrEndPromotion(1, json.get("ConflictPromotions").getAsJsonArray().get(0).getAsJsonObject().get("PromotionId").getAsInt());
			} else {
				JSellerPromotionCallService.CancelOrEndPromotion(1, PromotionId);
			}
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P3.class })
	@TestCase
	public void Tc_CreateSellerPromotion_002() {
		Logger.start(true, "不输入PromotionInfo，失败");
		try {
			JSellerPromotionCallService.CancelOrEndPromotion(1);
			createsellerpromotionBean = initCreateSellerPromotionBean(1, PromotionTypeEnum.ReduceIfCountEnough);

			createsellerpromotionBean.setPromotionInfo(null);
			createsellerpromotionCall.setData(createsellerpromotionBean);
			createsellerpromotionCall.callService();
			Logger.verifyIsContains("错误的请求参数", createsellerpromotionCall.getString("Msg"), "验证Msg");
			Logger.verifyEquals("400", createsellerpromotionCall.getString("Code"), "验证Code");
			Logger.verifyEquals("-1", createsellerpromotionCall.getString("BCode"), "验证BCode");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P3.class })
	@TestCase
	public void Tc_CreateSellerPromotion_003() {
		Logger.start(true, "不输入PromotionName，失败");
		try {
			JSellerPromotionCallService.CancelOrEndPromotion(1);
			createsellerpromotionBean = initCreateSellerPromotionBean(1, PromotionTypeEnum.ReduceIfCountEnough);

			createsellerpromotionBean.getPromotionInfo().setPromotionName(null);
			createsellerpromotionCall.setData(createsellerpromotionBean);
			createsellerpromotionCall.callService();
			Logger.verifyIsContains("促销活动名称不能为空", createsellerpromotionCall.getString("Msg"), "验证Msg");
			Logger.verifyEquals("400", createsellerpromotionCall.getString("Code"), "验证Code");
			Logger.verifyEquals("-1", createsellerpromotionCall.getString("BCode"), "验证BCode");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P3.class })
	@TestCase
	public void Tc_CreateSellerPromotion_004() {
		Logger.start(true, "不输入PromotionDesc，失败");
		try {
			JSellerPromotionCallService.CancelOrEndPromotion(1);
			createsellerpromotionBean = initCreateSellerPromotionBean(1, PromotionTypeEnum.ReduceIfCountEnough);

			createsellerpromotionBean.getPromotionInfo().setPromotionDesc(null);
			createsellerpromotionCall.setData(createsellerpromotionBean);
			createsellerpromotionCall.callService();
			Logger.verifyIsContains("促销活动描述不能为空", createsellerpromotionCall.getString("Msg"), "验证Msg");
			Logger.verifyEquals("400", createsellerpromotionCall.getString("Code"), "验证Code");
			Logger.verifyEquals("-1", createsellerpromotionCall.getString("BCode"), "验证BCode");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P3.class })
	@TestCase
	public void Tc_CreateSellerPromotion_005() {
		Logger.start(true, "不输入PromotionBeginTime，失败");
		try {
			JSellerPromotionCallService.CancelOrEndPromotion(1);
			createsellerpromotionBean = initCreateSellerPromotionBean(1, PromotionTypeEnum.ReduceIfCountEnough);

			createsellerpromotionBean.getPromotionInfo().setPromotionBeginTime(null);
			createsellerpromotionCall.setData(createsellerpromotionBean);
			createsellerpromotionCall.callService();
			Logger.verifyIsContains("促销活动开始时间不能为空", createsellerpromotionCall.getString("Msg"), "验证Msg");
			Logger.verifyEquals("400", createsellerpromotionCall.getString("Code"), "验证Code");
			Logger.verifyEquals("-1", createsellerpromotionCall.getString("BCode"), "验证BCode");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P3.class })
	@TestCase
	public void Tc_CreateSellerPromotion_006() {
		Logger.start(true, "不输入PromotionEndTime，失败");
		try {
			JSellerPromotionCallService.CancelOrEndPromotion(1);
			createsellerpromotionBean = initCreateSellerPromotionBean(1, PromotionTypeEnum.ReduceIfCountEnough);

			createsellerpromotionBean.getPromotionInfo().setPromotionEndTime(null);
			createsellerpromotionCall.setData(createsellerpromotionBean);
			createsellerpromotionCall.callService();
			Logger.verifyIsContains("促销活动结束时间不能为空", createsellerpromotionCall.getString("Msg"), "验证Msg");
			Logger.verifyEquals("400", createsellerpromotionCall.getString("Code"), "验证Code");
			Logger.verifyEquals("-1", createsellerpromotionCall.getString("BCode"), "验证BCode");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P3.class })
	@TestCase
	public void Tc_CreateSellerPromotion_007() {
		Logger.start(true, "不输入PromotionType，失败");
		try {
			JSellerPromotionCallService.CancelOrEndPromotion(1);
			createsellerpromotionBean = initCreateSellerPromotionBean(1, PromotionTypeEnum.ReduceIfCountEnough);

			createsellerpromotionBean.getPromotionInfo().setPromotionType(null);
			createsellerpromotionCall.setData(createsellerpromotionBean);
			createsellerpromotionCall.callService();
			Logger.verifyIsContains("无效的促销方式", createsellerpromotionCall.getString("Msg"), "验证Msg");
			Logger.verifyEquals("400", createsellerpromotionCall.getString("Code"), "验证Code");
			Logger.verifyEquals("-1", createsellerpromotionCall.getString("BCode"), "验证BCode");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P2.class })
	@TestCase
	public void Tc_CreateSellerPromotion_008() {
		Logger.start(true, "IsSpecifyProduct和IsLimitProduct同时为true，失败");
		try {
			JSellerPromotionCallService.CancelOrEndPromotion(1);
			createsellerpromotionBean = initCreateSellerPromotionBean(1, PromotionTypeEnum.ReduceIfCountEnough);
			createsellerpromotionBean.getPromotionInfo().setIsSpecifyProduct(true);
			createsellerpromotionBean.getPromotionInfo().setIsLimitProduct(true);
			addPromotionValue(createsellerpromotionBean, "1", "2");
			createsellerpromotionCall.setData(createsellerpromotionBean);
			createsellerpromotionCall.callService();
			Logger.verifyIsContains("指定商品和排除商品只能选择一种方式", createsellerpromotionCall.getString("Msg"), "验证Msg");
			Logger.verifyEquals("400", createsellerpromotionCall.getString("Code"), "验证Code");
			Logger.verifyEquals("-1", createsellerpromotionCall.getString("BCode"), "验证BCode");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P3.class })
	@TestCase
	public void Tc_CreateSellerPromotion_009() {
		Logger.start(true, "IsSpecifyProduct为true不输入ProductIds，失败");
		try {
			JSellerPromotionCallService.CancelOrEndPromotion(1);
			createsellerpromotionBean = initCreateSellerPromotionBean(1, PromotionTypeEnum.ReduceIfCountEnough);
			createsellerpromotionBean.getPromotionInfo().setIsSpecifyProduct(true);
			createsellerpromotionBean.getPromotionInfo().setIsLimitProduct(false);
			addPromotionValue(createsellerpromotionBean, "1", "2");
			createsellerpromotionCall.setData(createsellerpromotionBean);
			createsellerpromotionCall.callService();
			Logger.verifyIsContains("指定商品不能为空", createsellerpromotionCall.getString("Msg"), "验证Msg");
			Logger.verifyEquals("400", createsellerpromotionCall.getString("Code"), "验证Code");
			Logger.verifyEquals("-1", createsellerpromotionCall.getString("BCode"), "验证BCode");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P3.class })
	@TestCase
	public void Tc_CreateSellerPromotion_010() {
		Logger.start(true, "不输入PromotionValues，失败");
		try {
			JSellerPromotionCallService.CancelOrEndPromotion(1);
			createsellerpromotionBean = initCreateSellerPromotionBean(1, PromotionTypeEnum.ReduceIfCountEnough);
			// addPromotionValue(createsellerpromotionBean, "1","2");
			createsellerpromotionCall.setData(createsellerpromotionBean);
			createsellerpromotionCall.callService();
			Logger.verifyIsContains("促销规则不能为空", createsellerpromotionCall.getString("Msg"), "验证Msg");
			Logger.verifyEquals("400", createsellerpromotionCall.getString("Code"), "验证Code");
			Logger.verifyEquals("-1", createsellerpromotionCall.getString("BCode"), "验证BCode");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P2.class })
	@TestCase
	public void Tc_CreateSellerPromotion_011() {
		Logger.start(true, "PromotionBeginTime小于当前时间创建成功，PromotionBeginTime取当前时间");
		try {
			JSellerPromotionCallService.CancelOrEndPromotion(1);
			createsellerpromotionBean = initCreateSellerPromotionBean(1, PromotionTypeEnum.ReduceIfCountEnough);
			createsellerpromotionBean.getPromotionInfo().setPromotionBeginTime(YMTDateUtil.getBeforeOrNextDay(-1, YMTDateUtil.YMDTHMS_STRING));
			addPromotionValue(createsellerpromotionBean, "1", "2");
			createsellerpromotionCall.setData(createsellerpromotionBean);
			createsellerpromotionCall.callService();
			Logger.verifyEquals("操作成功", createsellerpromotionCall.getString("Msg"), "验证Msg");
			Logger.verifyEquals("200", createsellerpromotionCall.getString("Code"), "验证Code");
			Logger.verifyEquals("0", createsellerpromotionCall.getString("BCode"), "验证BCode");
			JsonObject json = createsellerpromotionCall.getJsonObject().getAsJsonObject("Data");
			Logger.verifyEquals(true, json.get("IsSuccess").getAsBoolean(), "验证IsSuccess");
			Logger.verifyEquals("无冲突满减促销", json.get("Msg").getAsString(), "验证Data.Msg");
			Integer PromotionId = json.get("PromotionId").getAsInt();
			verifyDB(PromotionId, createsellerpromotionBean);

			// 取消活动
			if (PromotionId == -1) {
				JSellerPromotionCallService.CancelOrEndPromotion(1, json.get("ConflictPromotions").getAsJsonArray().get(0).getAsJsonObject().get("PromotionId").getAsInt());
			} else {
				JSellerPromotionCallService.CancelOrEndPromotion(1, PromotionId);
			}

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P2.class })
	@TestCase
	public void Tc_CreateSellerPromotion_012() {
		Logger.start(true, "PromotionEndTime小于PromotionBeginTime，失败");
		try {
			JSellerPromotionCallService.CancelOrEndPromotion(1);
			createsellerpromotionBean = initCreateSellerPromotionBean(1, PromotionTypeEnum.ReduceIfCountEnough);
			createsellerpromotionBean.getPromotionInfo().setPromotionBeginTime(YMTDateUtil.getBeforeOrNextDay(2, YMTDateUtil.YMDTHMS_STRING));
			createsellerpromotionBean.getPromotionInfo().setPromotionEndTime(YMTDateUtil.getBeforeOrNextDay(1, YMTDateUtil.YMDTHMS_STRING));
			addPromotionValue(createsellerpromotionBean, "1", "2");
			createsellerpromotionCall.setData(createsellerpromotionBean);
			createsellerpromotionCall.callService();
			Logger.verifyIsContains("促销结束时间必须", createsellerpromotionCall.getString("Msg"), "验证Msg");
			Logger.verifyEquals("400", createsellerpromotionCall.getString("Code"), "验证Code");
			Logger.verifyEquals("-1", createsellerpromotionCall.getString("BCode"), "验证BCode");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P2.class })
	@TestCase
	public void Tc_CreateSellerPromotion_013() {
		Logger.start(true, "PromotionEndTime在PromotionBeginTime1天内，失败");
		try {
			JSellerPromotionCallService.CancelOrEndPromotion(1);
			createsellerpromotionBean = initCreateSellerPromotionBean(1, PromotionTypeEnum.ReduceIfCountEnough);
			createsellerpromotionBean.getPromotionInfo().setPromotionBeginTime(YMTDateUtil.getBeforeOrNextDay(1, YMTDateUtil.YMDTHMS_STRING));
			createsellerpromotionBean.getPromotionInfo().setPromotionEndTime(YMTDateUtil.getBeforeOrNextDay(1, YMTDateUtil.YMDTHMS_STRING));
			addPromotionValue(createsellerpromotionBean, "1", "2");
			createsellerpromotionCall.setData(createsellerpromotionBean);
			createsellerpromotionCall.callService();
			Logger.verifyIsContains("促销活动时间最短1天，最长30天", createsellerpromotionCall.getString("Msg"), "验证Msg");
			Logger.verifyEquals("400", createsellerpromotionCall.getString("Code"), "验证Code");
			Logger.verifyEquals("-1", createsellerpromotionCall.getString("BCode"), "验证BCode");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P2.class })
	@TestCase
	public void Tc_CreateSellerPromotion_014() {
		Logger.start(true, "PromotionEndTime在PromotionBeginTime30天后，失败");
		try {
			JSellerPromotionCallService.CancelOrEndPromotion(1);
			createsellerpromotionBean = initCreateSellerPromotionBean(1, PromotionTypeEnum.ReduceIfCountEnough);
			createsellerpromotionBean.getPromotionInfo().setPromotionBeginTime(YMTDateUtil.getBeforeOrNextDay(1, YMTDateUtil.YMDTHMS_STRING));
			createsellerpromotionBean.getPromotionInfo().setPromotionEndTime(YMTDateUtil.getBeforeOrNextDay(32, YMTDateUtil.YMDTHMS_STRING));
			addPromotionValue(createsellerpromotionBean, "1", "2");
			createsellerpromotionCall.setData(createsellerpromotionBean);
			createsellerpromotionCall.callService();
			Logger.verifyIsContains("促销活动时间最短1天，最长30天", createsellerpromotionCall.getString("Msg"), "验证Msg");
			Logger.verifyEquals("400", createsellerpromotionCall.getString("Code"), "验证Code");
			Logger.verifyEquals("-1", createsellerpromotionCall.getString("BCode"), "验证BCode");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P2.class })
	@TestCase
	public void Tc_CreateSellerPromotion_015() {
		Logger.start(true, "创建满件折PromotionType2促销活动成功");
		try {
			JSellerPromotionCallService.CancelOrEndPromotion(1);
			createsellerpromotionBean = initCreateSellerPromotionBean(1, PromotionTypeEnum.DiscountIfCountEnough);
			addPromotionValue(createsellerpromotionBean, "1", "2");
			createsellerpromotionCall.setData(createsellerpromotionBean);
			createsellerpromotionCall.callService();
			Logger.verifyEquals("操作成功", createsellerpromotionCall.getString("Msg"), "验证Msg");
			Logger.verifyEquals("200", createsellerpromotionCall.getString("Code"), "验证Code");
			Logger.verifyEquals("0", createsellerpromotionCall.getString("BCode"), "验证BCode");
			JsonObject json = createsellerpromotionCall.getJsonObject().getAsJsonObject("Data");
			Logger.verifyEquals(true, json.get("IsSuccess").getAsBoolean(), "验证IsSuccess");
			Logger.verifyEquals("无冲突满减促销", json.get("Msg").getAsString(), "验证Data.Msg");
			Integer PromotionId = json.get("PromotionId").getAsInt();
			verifyDB(PromotionId, createsellerpromotionBean);

			// 取消活动
			if (PromotionId == -1) {
				JSellerPromotionCallService.CancelOrEndPromotion(1, json.get("ConflictPromotions").getAsJsonArray().get(0).getAsJsonObject().get("PromotionId").getAsInt());
			} else {
				JSellerPromotionCallService.CancelOrEndPromotion(1, PromotionId);
			}

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P2.class })
	@TestCase
	public void Tc_CreateSellerPromotion_016() {
		Logger.start(true, "创建满额减PromotionType3促销活动成功");
		try {
			JSellerPromotionCallService.CancelOrEndPromotion(1);
			createsellerpromotionBean = initCreateSellerPromotionBean(1, PromotionTypeEnum.ReduceIfAmountEnough);
			addPromotionValue(createsellerpromotionBean, "10", "2");
			createsellerpromotionCall.setData(createsellerpromotionBean);
			createsellerpromotionCall.callService();
			Logger.verifyEquals("操作成功", createsellerpromotionCall.getString("Msg"), "验证Msg");
			Logger.verifyEquals("200", createsellerpromotionCall.getString("Code"), "验证Code");
			Logger.verifyEquals("0", createsellerpromotionCall.getString("BCode"), "验证BCode");
			JsonObject json = createsellerpromotionCall.getJsonObject().getAsJsonObject("Data");
			Logger.verifyEquals(true, json.get("IsSuccess").getAsBoolean(), "验证IsSuccess");
			Logger.verifyEquals("无冲突满减促销", json.get("Msg").getAsString(), "验证Data.Msg");
			Integer PromotionId = json.get("PromotionId").getAsInt();
			verifyDB(PromotionId, createsellerpromotionBean);

			// 取消活动
			if (PromotionId == -1) {
				JSellerPromotionCallService.CancelOrEndPromotion(1, json.get("ConflictPromotions").getAsJsonArray().get(0).getAsJsonObject().get("PromotionId").getAsInt());
			} else {
				JSellerPromotionCallService.CancelOrEndPromotion(1, PromotionId);
			}

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P2.class })
	@TestCase
	public void Tc_CreateSellerPromotion_017() {
		Logger.start(true, "创建满额折PromotionType4促销活动成功");
		try {
			JSellerPromotionCallService.CancelOrEndPromotion(1);
			createsellerpromotionBean = initCreateSellerPromotionBean(1, PromotionTypeEnum.DiscountIfAmountEnough);
			addPromotionValue(createsellerpromotionBean, "10", "2");
			createsellerpromotionCall.setData(createsellerpromotionBean);
			createsellerpromotionCall.callService();
			Logger.verifyEquals("操作成功", createsellerpromotionCall.getString("Msg"), "验证Msg");
			Logger.verifyEquals("200", createsellerpromotionCall.getString("Code"), "验证Code");
			Logger.verifyEquals("0", createsellerpromotionCall.getString("BCode"), "验证BCode");
			JsonObject json = createsellerpromotionCall.getJsonObject().getAsJsonObject("Data");
			Logger.verifyEquals(true, json.get("IsSuccess").getAsBoolean(), "验证IsSuccess");
			Logger.verifyEquals("无冲突满减促销", json.get("Msg").getAsString(), "验证Data.Msg");
			Integer PromotionId = json.get("PromotionId").getAsInt();
			verifyDB(PromotionId, createsellerpromotionBean);

			// 取消活动
			if (PromotionId == -1) {
				JSellerPromotionCallService.CancelOrEndPromotion(1, json.get("ConflictPromotions").getAsJsonArray().get(0).getAsJsonObject().get("PromotionId").getAsInt());
			} else {
				JSellerPromotionCallService.CancelOrEndPromotion(1, PromotionId);
			}

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P2.class })
	@TestCase
	public void Tc_CreateSellerPromotion_018() {
		Logger.start(true, "创建满额折SecondHalf5促销活动成功,PromotionValues固定参数{AmountCondition=0,QtyCondition=2,Value=5m}1条");
		try {
			JSellerPromotionCallService.CancelOrEndPromotion(1);
			createsellerpromotionBean = initCreateSellerPromotionBean(1, PromotionTypeEnum.HalfIfCountEnough);
			addPromotionValue(createsellerpromotionBean, "10", "2");
			createsellerpromotionCall.setData(createsellerpromotionBean);
			createsellerpromotionCall.callService();
			Logger.verifyEquals("操作成功", createsellerpromotionCall.getString("Msg"), "验证Msg");
			Logger.verifyEquals("200", createsellerpromotionCall.getString("Code"), "验证Code");
			Logger.verifyEquals("0", createsellerpromotionCall.getString("BCode"), "验证BCode");
			JsonObject json = createsellerpromotionCall.getJsonObject().getAsJsonObject("Data");
			Logger.verifyEquals(true, json.get("IsSuccess").getAsBoolean(), "验证IsSuccess");
			Logger.verifyEquals("无冲突满减促销", json.get("Msg").getAsString(), "验证Data.Msg");
			Integer PromotionId = json.get("PromotionId").getAsInt();
			verifyDB(PromotionId, createsellerpromotionBean);

			// 取消活动
			if (PromotionId == -1) {
				JSellerPromotionCallService.CancelOrEndPromotion(1, json.get("ConflictPromotions").getAsJsonArray().get(0).getAsJsonObject().get("PromotionId").getAsInt());
			} else {
				JSellerPromotionCallService.CancelOrEndPromotion(1, PromotionId);
			}

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P2.class })
	@TestCase
	public void Tc_CreateSellerPromotion_019() {
		Logger.start(true, "创建满件减PromotionType1，QtyCondition为空失败");
		try {
			JSellerPromotionCallService.CancelOrEndPromotion(1);
			createsellerpromotionBean = initCreateSellerPromotionBean(1, PromotionTypeEnum.ReduceIfCountEnough);
			addPromotionValue(createsellerpromotionBean, null, "2");
			createsellerpromotionCall.setData(createsellerpromotionBean);
			createsellerpromotionCall.callService();
			Logger.verifyIsContains("满件条件必须", createsellerpromotionCall.getString("Msg"), "验证Msg");
			Logger.verifyEquals("400", createsellerpromotionCall.getString("Code"), "验证Code");
			Logger.verifyEquals("-1", createsellerpromotionCall.getString("BCode"), "验证BCode");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P2.class })
	@TestCase
	public void Tc_CreateSellerPromotion_020() {
		Logger.start(true, "创建满件减PromotionType1，QtyCondition为负数失败");
		try {
			JSellerPromotionCallService.CancelOrEndPromotion(1);
			createsellerpromotionBean = initCreateSellerPromotionBean(1, PromotionTypeEnum.ReduceIfCountEnough);
			addPromotionValue(createsellerpromotionBean, "-1", "2");
			createsellerpromotionCall.setData(createsellerpromotionBean);
			createsellerpromotionCall.callService();
			Logger.verifyIsContains("满件条件必须", createsellerpromotionCall.getString("Msg"), "验证Msg");
			Logger.verifyEquals("400", createsellerpromotionCall.getString("Code"), "验证Code");
			Logger.verifyEquals("-1", createsellerpromotionCall.getString("BCode"), "验证BCode");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P2.class })
	@TestCase
	public void Tc_CreateSellerPromotion_021() {
		Logger.start(true, "重复创建满件减PromotionType1指定商品,IsSpecifyProduct为true,ProductIds同一个重复调用,失败");
		try {
			JSellerPromotionCallService.CancelOrEndPromotion(2);
			createsellerpromotionBean = initCreateSellerPromotionBean(2, PromotionTypeEnum.ReduceIfCountEnough);
			createsellerpromotionBean.getPromotionInfo().setIsSpecifyProduct(true);
			createsellerpromotionBean.getPromotionInfo().setIsLimitProduct(false);
			addPromotionValue(createsellerpromotionBean, "10", "2");
			List<Map> bpw = new YmtBuyerProductWapper().getLimit(2);
			String pid = bpw.get(0).get("ProductId").toString();
			createsellerpromotionBean.getPromotionInfo().getProductIds().add(pid);
			createsellerpromotionCall.setData(createsellerpromotionBean);
			createsellerpromotionCall.callService();

			Logger.verifyEquals("操作成功", createsellerpromotionCall.getString("Msg"), "验证Msg");
			Logger.verifyEquals("200", createsellerpromotionCall.getString("Code"), "验证Code");
			Logger.verifyEquals("0", createsellerpromotionCall.getString("BCode"), "验证BCode");
			JsonObject json = createsellerpromotionCall.getJsonObject().getAsJsonObject("Data");
			Logger.verifyEquals(true, json.get("IsSuccess").getAsBoolean(), "验证IsSuccess");
			Logger.verifyEquals("无冲突满减促销", json.get("Msg").getAsString(), "验证Data.Msg");
			Integer PromotionId = json.get("PromotionId").getAsInt();
			verifyDB(PromotionId, createsellerpromotionBean);

			createsellerpromotionCall.callService();
			Logger.verifyEquals("200", createsellerpromotionCall.getString("Code"), "验证Code");
			Logger.verifyEquals("0", createsellerpromotionCall.getString("BCode"), "验证BCode");
			json = createsellerpromotionCall.getJsonObject().getAsJsonObject("Data");
			Logger.verifyEquals(false, json.get("IsSuccess").getAsBoolean(), "验证IsSuccess");
			Logger.verifyIsContains("指定商品与其它促销活动冲突", json.get("Msg").getAsString(), "验证Data.Msg");
			// 取消活动
			if (PromotionId == -1) {
				JSellerPromotionCallService.CancelOrEndPromotion(2, json.get("ConflictPromotions").getAsJsonArray().get(0).getAsJsonObject().get("PromotionId").getAsInt());
			} else {
				JSellerPromotionCallService.CancelOrEndPromotion(2, PromotionId);
			}

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P2.class })
	@TestCase
	public void Tc_CreateSellerPromotion_022() {
		Logger.start(true, "创建满件折PromotionType2，QtyCondition为空失败");
		try {
			JSellerPromotionCallService.CancelOrEndPromotion(1);
			createsellerpromotionBean = initCreateSellerPromotionBean(1, PromotionTypeEnum.DiscountIfCountEnough);
			addPromotionValue(createsellerpromotionBean, null, "2");
			createsellerpromotionCall.setData(createsellerpromotionBean);
			createsellerpromotionCall.callService();
			Logger.verifyIsContains("满件条件必须", createsellerpromotionCall.getString("Msg"), "验证Msg");
			Logger.verifyEquals("400", createsellerpromotionCall.getString("Code"), "验证Code");
			Logger.verifyEquals("-1", createsellerpromotionCall.getString("BCode"), "验证BCode");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P2.class })
	@TestCase
	public void Tc_CreateSellerPromotion_023() {
		Logger.start(true, "创建满件折PromotionType2，QtyCondition为负数失败");
		try {
			JSellerPromotionCallService.CancelOrEndPromotion(1);
			createsellerpromotionBean = initCreateSellerPromotionBean(1, PromotionTypeEnum.DiscountIfCountEnough);
			addPromotionValue(createsellerpromotionBean, "-1", "2");
			createsellerpromotionCall.setData(createsellerpromotionBean);
			createsellerpromotionCall.callService();
			Logger.verifyIsContains("满件条件必须", createsellerpromotionCall.getString("Msg"), "验证Msg");
			Logger.verifyEquals("400", createsellerpromotionCall.getString("Code"), "验证Code");
			Logger.verifyEquals("-1", createsellerpromotionCall.getString("BCode"), "验证BCode");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P2.class })
	@TestCase
	public void Tc_CreateSellerPromotion_024() {
		Logger.start(true, "创建满额减PromotionType3，AmountCondition为空失败");
		try {
			JSellerPromotionCallService.CancelOrEndPromotion(1);
			createsellerpromotionBean = initCreateSellerPromotionBean(1, PromotionTypeEnum.ReduceIfAmountEnough);
			addPromotionValue(createsellerpromotionBean, null, "2");
			createsellerpromotionCall.setData(createsellerpromotionBean);
			createsellerpromotionCall.callService();
			Logger.verifyIsContains("满额条件不能", createsellerpromotionCall.getString("Msg"), "验证Msg");
			Logger.verifyEquals("400", createsellerpromotionCall.getString("Code"), "验证Code");
			Logger.verifyEquals("-1", createsellerpromotionCall.getString("BCode"), "验证BCode");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P2.class })
	@TestCase
	public void Tc_CreateSellerPromotion_025() {
		Logger.start(true, "创建满额减PromotionType3，AmountCondition为负数失败");
		try {
			JSellerPromotionCallService.CancelOrEndPromotion(1);
			createsellerpromotionBean = initCreateSellerPromotionBean(1, PromotionTypeEnum.ReduceIfAmountEnough);
			addPromotionValue(createsellerpromotionBean, "-1", "2");
			createsellerpromotionCall.setData(createsellerpromotionBean);
			createsellerpromotionCall.callService();
			Logger.verifyIsContains("满额条件必须", createsellerpromotionCall.getString("Msg"), "验证Msg");
			Logger.verifyEquals("400", createsellerpromotionCall.getString("Code"), "验证Code");
			Logger.verifyEquals("-1", createsellerpromotionCall.getString("BCode"), "验证BCode");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P2.class })
	@TestCase
	public void Tc_CreateSellerPromotion_026() {
		Logger.start(true, "创建满额折PromotionType4，AmountCondition为空失败");
		try {
			JSellerPromotionCallService.CancelOrEndPromotion(1);
			createsellerpromotionBean = initCreateSellerPromotionBean(1, PromotionTypeEnum.DiscountIfAmountEnough);
			addPromotionValue(createsellerpromotionBean, null, "2");
			createsellerpromotionCall.setData(createsellerpromotionBean);
			createsellerpromotionCall.callService();
			Logger.verifyIsContains("满额条件不能", createsellerpromotionCall.getString("Msg"), "验证Msg");
			Logger.verifyEquals("400", createsellerpromotionCall.getString("Code"), "验证Code");
			Logger.verifyEquals("-1", createsellerpromotionCall.getString("BCode"), "验证BCode");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P2.class })
	@TestCase
	public void Tc_CreateSellerPromotion_027() {
		Logger.start(true, "创建满额折PromotionType4，AmountCondition为负数失败");
		try {
			JSellerPromotionCallService.CancelOrEndPromotion(1);
			createsellerpromotionBean = initCreateSellerPromotionBean(1, PromotionTypeEnum.DiscountIfAmountEnough);
			addPromotionValue(createsellerpromotionBean, "-1", "2");
			createsellerpromotionCall.setData(createsellerpromotionBean);
			createsellerpromotionCall.callService();
			Logger.verifyIsContains("满额条件必须", createsellerpromotionCall.getString("Msg"), "验证Msg");
			Logger.verifyEquals("400", createsellerpromotionCall.getString("Code"), "验证Code");
			Logger.verifyEquals("-1", createsellerpromotionCall.getString("BCode"), "验证BCode");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P2.class })
	@TestCase
	public void Tc_CreateSellerPromotion_028() {
		Logger.start(true, "创建满件减PromotionType1，规则(IsSpecifyProduct为true,ProductIds不同但是QtyCondition相同)重复失败");
		try {
			JSellerPromotionCallService.CancelOrEndPromotion(2);
			createsellerpromotionBean = initCreateSellerPromotionBean(2, PromotionTypeEnum.ReduceIfCountEnough);
			createsellerpromotionBean.getPromotionInfo().setIsSpecifyProduct(true);
			createsellerpromotionBean.getPromotionInfo().setIsLimitProduct(false);
			addPromotionValue(createsellerpromotionBean, "10", "2");
			addPromotionValue(createsellerpromotionBean, "10", "2");
			List<Map> bpw = new YmtBuyerProductWapper().getLimit(2);
			String pid = bpw.get(0).get("ProductId").toString();
			String pid2 = bpw.get(1).get("ProductId").toString();
			createsellerpromotionBean.getPromotionInfo().getProductIds().add(pid);
			createsellerpromotionBean.getPromotionInfo().getProductIds().add(pid2);
			createsellerpromotionCall.setData(createsellerpromotionBean);
			createsellerpromotionCall.callService();

			Logger.verifyIsContains("满件条件有重复", createsellerpromotionCall.getString("Msg"), "验证Msg");
			Logger.verifyEquals("400", createsellerpromotionCall.getString("Code"), "验证Code");
			Logger.verifyEquals("-1", createsellerpromotionCall.getString("BCode"), "验证BCode");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P2.class })
	@TestCase
	public void Tc_CreateSellerPromotion_029() {
		Logger.start(true, "创建满件折PromotionType2，PromotionValue.Value小于0,失败");
		try {
			JSellerPromotionCallService.CancelOrEndPromotion(1);
			createsellerpromotionBean = initCreateSellerPromotionBean(1, PromotionTypeEnum.DiscountIfCountEnough);
			addPromotionValue(createsellerpromotionBean, "1", "-2");
			createsellerpromotionCall.setData(createsellerpromotionBean);
			createsellerpromotionCall.callService();
			Logger.verifyIsContains("折扣必须", createsellerpromotionCall.getString("Msg"), "验证Msg");
			Logger.verifyEquals("400", createsellerpromotionCall.getString("Code"), "验证Code");
			Logger.verifyEquals("-1", createsellerpromotionCall.getString("BCode"), "验证BCode");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P2.class })
	@TestCase
	public void Tc_CreateSellerPromotion_030() {
		Logger.start(true, "创建满额折PromotionType4，PromotionValue.Value大于9.9,失败");
		try {
			JSellerPromotionCallService.CancelOrEndPromotion(1);
			createsellerpromotionBean = initCreateSellerPromotionBean(1, PromotionTypeEnum.DiscountIfAmountEnough);
			addPromotionValue(createsellerpromotionBean, "10", "9.91");
			createsellerpromotionCall.setData(createsellerpromotionBean);
			createsellerpromotionCall.callService();
			Logger.verifyIsContains("折扣最大不能超过9.9折", createsellerpromotionCall.getString("Msg"), "验证Msg");
			Logger.verifyEquals("400", createsellerpromotionCall.getString("Code"), "验证Code");
			Logger.verifyEquals("-1", createsellerpromotionCall.getString("BCode"), "验证BCode");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P2.class })
	@TestCase
	public void Tc_CreateSellerPromotion_031() {
		Logger.start(true, "创建满件减PromotionType1，PromotionValue.Value小于0,失败");
		try {
			JSellerPromotionCallService.CancelOrEndPromotion(1);
			createsellerpromotionBean = initCreateSellerPromotionBean(1, PromotionTypeEnum.ReduceIfCountEnough);
			addPromotionValue(createsellerpromotionBean, "1", "-2");
			createsellerpromotionCall.setData(createsellerpromotionBean);
			createsellerpromotionCall.callService();
			Logger.verifyIsContains("立减金额必须", createsellerpromotionCall.getString("Msg"), "验证Msg");
			Logger.verifyEquals("400", createsellerpromotionCall.getString("Code"), "验证Code");
			Logger.verifyEquals("-1", createsellerpromotionCall.getString("BCode"), "验证BCode");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P2.class })
	@TestCase
	public void Tc_CreateSellerPromotion_032() {
		Logger.start(true, "创建满额减PromotionType3，PromotionValue.Value大于AmountCondition(满金额比优惠小),失败");
		try {
			JSellerPromotionCallService.CancelOrEndPromotion(1);
			createsellerpromotionBean = initCreateSellerPromotionBean(1, PromotionTypeEnum.ReduceIfAmountEnough);
			addPromotionValue(createsellerpromotionBean, "10", "11");
			createsellerpromotionCall.setData(createsellerpromotionBean);
			createsellerpromotionCall.callService();
			Logger.verifyIsContains("立减金额必须", createsellerpromotionCall.getString("Msg"), "验证Msg");
			Logger.verifyEquals("400", createsellerpromotionCall.getString("Code"), "验证Code");
			Logger.verifyEquals("-1", createsellerpromotionCall.getString("BCode"), "验证BCode");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P3.class })
	@TestCase
	public void Tc_CreateSellerPromotion_033() {
		Logger.start(true, "IsLimitProduct为true不输入ProductIds，失败cp009");
		try {
			JSellerPromotionCallService.CancelOrEndPromotion(1);
			createsellerpromotionBean = initCreateSellerPromotionBean(1, PromotionTypeEnum.ReduceIfCountEnough);
			createsellerpromotionBean.getPromotionInfo().setIsSpecifyProduct(false);
			createsellerpromotionBean.getPromotionInfo().setIsLimitProduct(true);
			addPromotionValue(createsellerpromotionBean, "1", "2");
			createsellerpromotionCall.setData(createsellerpromotionBean);
			createsellerpromotionCall.callService();
			Logger.verifyIsContains("排除商品不能为空", createsellerpromotionCall.getString("Msg"), "验证Msg");
			Logger.verifyEquals("400", createsellerpromotionCall.getString("Code"), "验证Code");
			Logger.verifyEquals("-1", createsellerpromotionCall.getString("BCode"), "验证BCode");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P2.class })
	@TestCase
	public void Tc_CreateSellerPromotion_034() {
		Logger.start(true, "同一买手创建活动超过MaxCreatePromotionCount(disconf:def3),失败");
		try {
			JSellerPromotionCallService.CancelOrEndPromotion(2);
			createsellerpromotionBean = initCreateSellerPromotionBean(2, PromotionTypeEnum.ReduceIfCountEnough);
			createsellerpromotionBean.getPromotionInfo().setIsSpecifyProduct(true);
			createsellerpromotionBean.getPromotionInfo().setIsLimitProduct(false);
			addPromotionValue(createsellerpromotionBean, "10", "2");
			List<Map> bpw = new YmtBuyerProductWapper().getLimit(4);
			String pid = bpw.get(0).get("ProductId").toString();
			createsellerpromotionBean.getPromotionInfo().getProductIds().add(pid);
			createsellerpromotionCall.setData(createsellerpromotionBean);
			createsellerpromotionCall.callService();

			Logger.verifyEquals("操作成功", createsellerpromotionCall.getString("Msg"), "验证Msg");
			Logger.verifyEquals("200", createsellerpromotionCall.getString("Code"), "验证Code");
			Logger.verifyEquals("0", createsellerpromotionCall.getString("BCode"), "验证BCode");
			JsonObject json = createsellerpromotionCall.getJsonObject().getAsJsonObject("Data");
			Logger.verifyEquals(true, json.get("IsSuccess").getAsBoolean(), "验证IsSuccess");
			Logger.verifyEquals("无冲突满减促销", json.get("Msg").getAsString(), "验证Data.Msg");
			Integer PromotionId = json.get("PromotionId").getAsInt();
			verifyDB(PromotionId, createsellerpromotionBean);

			Logger.comment("创建第二个活动");
			createsellerpromotionCall=new CreateSellerPromotionCall();
			pid = bpw.get(1).get("ProductId").toString();
			createsellerpromotionBean.getPromotionInfo().getProductIds().clear();
			createsellerpromotionBean.getPromotionInfo().getProductIds().add(pid);
			createsellerpromotionCall.setData(createsellerpromotionBean);
			createsellerpromotionCall.callService();
			Logger.verifyEquals("操作成功", createsellerpromotionCall.getString("Msg"), "验证Msg");
			Logger.verifyEquals("200", createsellerpromotionCall.getString("Code"), "验证Code");
			Logger.verifyEquals("0", createsellerpromotionCall.getString("BCode"), "验证BCode");
			json = createsellerpromotionCall.getJsonObject().getAsJsonObject("Data");
			Logger.verifyEquals(true, json.get("IsSuccess").getAsBoolean(), "验证IsSuccess");
			Logger.verifyEquals("无冲突满减促销", json.get("Msg").getAsString(), "验证Data.Msg");
			PromotionId = json.get("PromotionId").getAsInt();
			verifyDB(PromotionId, createsellerpromotionBean);
			
			Logger.comment("创建第三个活动");
			createsellerpromotionCall=new CreateSellerPromotionCall();
			pid = bpw.get(2).get("ProductId").toString();
			createsellerpromotionBean.getPromotionInfo().getProductIds().clear();
			createsellerpromotionBean.getPromotionInfo().getProductIds().add(pid);
			createsellerpromotionCall.setData(createsellerpromotionBean);
			createsellerpromotionCall.callService();
			Logger.verifyEquals("操作成功", createsellerpromotionCall.getString("Msg"), "验证Msg");
			Logger.verifyEquals("200", createsellerpromotionCall.getString("Code"), "验证Code");
			Logger.verifyEquals("0", createsellerpromotionCall.getString("BCode"), "验证BCode");
			json = createsellerpromotionCall.getJsonObject().getAsJsonObject("Data");
			Logger.verifyEquals(true, json.get("IsSuccess").getAsBoolean(), "验证IsSuccess");
			Logger.verifyEquals("无冲突满减促销", json.get("Msg").getAsString(), "验证Data.Msg");
			PromotionId = json.get("PromotionId").getAsInt();
			verifyDB(PromotionId, createsellerpromotionBean);
			
			Logger.comment("创建第四个活动");
			createsellerpromotionCall=new CreateSellerPromotionCall();
			pid = bpw.get(3).get("ProductId").toString();
			createsellerpromotionBean.getPromotionInfo().getProductIds().clear();
			createsellerpromotionBean.getPromotionInfo().getProductIds().add(pid);
			createsellerpromotionCall.setData(createsellerpromotionBean);
			createsellerpromotionCall.callService();
			Logger.verifyEquals("200", createsellerpromotionCall.getString("Code"), "验证Code");
			Logger.verifyEquals("0", createsellerpromotionCall.getString("BCode"), "验证BCode");

			json = createsellerpromotionCall.getJsonObject().getAsJsonObject("Data");
			Logger.verifyEquals(false, json.get("IsSuccess").getAsBoolean(), "验证IsSuccess");
			Logger.verifyIsContains("系统最多允许3个促销活动同时有效", json.get("Msg").getAsString(), "验证Data.Msg");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P2.class })
	@TestCase
	public void Tc_CreateSellerPromotion_035() {
		Logger.start(true, "创建活动指定商品数量超过MaxAddProductCount(disconf:def100),失败");
		try {
			JSellerPromotionCallService.CancelOrEndPromotion(2);
			createsellerpromotionBean = initCreateSellerPromotionBean(2, PromotionTypeEnum.ReduceIfCountEnough);
			createsellerpromotionBean.getPromotionInfo().setIsSpecifyProduct(true);
			createsellerpromotionBean.getPromotionInfo().setIsLimitProduct(false);
			addPromotionValue(createsellerpromotionBean, "10", "2");
			List<Map> bpw = new YmtBuyerProductWapper().getLimit(101);
			for (Map map : bpw) {
				String pid = map.get("ProductId").toString();
				createsellerpromotionBean.getPromotionInfo().getProductIds().add(pid);
			}
			
			createsellerpromotionCall.setData(createsellerpromotionBean);
			createsellerpromotionCall.callService();

			Logger.verifyIsContains("每场促销指定（排除）商品必须", createsellerpromotionCall.getString("Msg"), "验证Msg");
			Logger.verifyEquals("400", createsellerpromotionCall.getString("Code"), "验证Code");
			Logger.verifyEquals("-1", createsellerpromotionCall.getString("BCode"), "验证BCode");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P2.class })
	@TestCase
	public void Tc_CreateSellerPromotion_036() {
		Logger.start(true, "创建全场促销活动后再创建活动(IsSpecifyProduct和IsLimitProduct同时为false),失败");
		try {
			JSellerPromotionCallService.CancelOrEndPromotion(1);
			createsellerpromotionBean = initCreateSellerPromotionBean(1, PromotionTypeEnum.ReduceIfCountEnough);
			addPromotionValue(createsellerpromotionBean, "1", "2");
			createsellerpromotionCall.setData(createsellerpromotionBean);
			createsellerpromotionCall.callService();
			Logger.verifyEquals("操作成功", createsellerpromotionCall.getString("Msg"), "验证Msg");
			Logger.verifyEquals("200", createsellerpromotionCall.getString("Code"), "验证Code");
			Logger.verifyEquals("0", createsellerpromotionCall.getString("BCode"), "验证BCode");
			JsonObject json = createsellerpromotionCall.getJsonObject().getAsJsonObject("Data");
			Logger.verifyEquals(true, json.get("IsSuccess").getAsBoolean(), "验证IsSuccess");
			Logger.verifyEquals("无冲突满减促销", json.get("Msg").getAsString(), "验证Data.Msg");
			Integer PromotionId = json.get("PromotionId").getAsInt();
			verifyDB(PromotionId, createsellerpromotionBean);
			
			createsellerpromotionBean.getPromotionInfo().setIsSpecifyProduct(true);
			createsellerpromotionBean.getPromotionInfo().setIsLimitProduct(false);
			List<Map> bpw = new YmtBuyerProductWapper().getLimit(4);
			String pid = bpw.get(0).get("ProductId").toString();
			createsellerpromotionBean.getPromotionInfo().getProductIds().add(pid);
			createsellerpromotionCall.callService();
			 json = createsellerpromotionCall.getJsonObject().getAsJsonObject("Data");
			Logger.verifyEquals("200", createsellerpromotionCall.getString("Code"), "验证Code");
			Logger.verifyEquals("0", createsellerpromotionCall.getString("BCode"), "验证BCode");
			Logger.verifyEquals(false, json.get("IsSuccess").getAsBoolean(), "验证IsSuccess");
			Logger.verifyEquals("已经创建过全场促销活动", json.get("Msg").getAsString(), "验证Data.Msg");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P2.class })
	@TestCase
	public void Tc_CreateSellerPromotion_037() {
		Logger.start(true, "创建促销活动指定排除商品后(IsLimitProduct=true),再创建此商品的指定促销活动成功(IsSpecifyProduct为true),然后再创建此商品的指定促销活动失败(重复)");
		try {
			Logger.comment("创建(IsLimitProduct=true)");
			JSellerPromotionCallService.CancelOrEndPromotion(3);
			createsellerpromotionBean = initCreateSellerPromotionBean(3, PromotionTypeEnum.ReduceIfCountEnough);
			addPromotionValue(createsellerpromotionBean, "1", "2");
			createsellerpromotionBean.getPromotionInfo().setIsSpecifyProduct(false);
			createsellerpromotionBean.getPromotionInfo().setIsLimitProduct(true);
			List<Map> bpw = new YmtBuyerProductWapper().getLimit(4);
			String pid = bpw.get(0).get("ProductId").toString();
			createsellerpromotionBean.getPromotionInfo().getProductIds().add(pid);
			createsellerpromotionCall.setData(createsellerpromotionBean);
			createsellerpromotionCall.callService();
			Logger.verifyEquals("操作成功", createsellerpromotionCall.getString("Msg"), "验证Msg");
			Logger.verifyEquals("200", createsellerpromotionCall.getString("Code"), "验证Code");
			Logger.verifyEquals("0", createsellerpromotionCall.getString("BCode"), "验证BCode");
			JsonObject json = createsellerpromotionCall.getJsonObject().getAsJsonObject("Data");
			Logger.verifyEquals(true, json.get("IsSuccess").getAsBoolean(), "验证IsSuccess");
			Logger.verifyEquals("无冲突满减促销", json.get("Msg").getAsString(), "验证Data.Msg");
			Integer PromotionId = json.get("PromotionId").getAsInt();
			verifyDB(PromotionId, createsellerpromotionBean);
			
			Logger.comment("创建(IsSpecifyProduct=true)");
			createsellerpromotionBean.getPromotionInfo().setIsSpecifyProduct(true);
			createsellerpromotionBean.getPromotionInfo().setIsLimitProduct(false);
			createsellerpromotionCall.setData(createsellerpromotionBean);
			createsellerpromotionCall.callService();
			Logger.verifyEquals("操作成功", createsellerpromotionCall.getString("Msg"), "验证Msg");
			Logger.verifyEquals("200", createsellerpromotionCall.getString("Code"), "验证Code");
			Logger.verifyEquals("0", createsellerpromotionCall.getString("BCode"), "验证BCode");
			json = createsellerpromotionCall.getJsonObject().getAsJsonObject("Data");
			Logger.verifyEquals(true, json.get("IsSuccess").getAsBoolean(), "验证IsSuccess");
			Logger.verifyEquals("无冲突满减促销", json.get("Msg").getAsString(), "验证Data.Msg");
			PromotionId = json.get("PromotionId").getAsInt();
			verifyDB(PromotionId, createsellerpromotionBean);
			
			Logger.comment("再次创建(IsSpecifyProduct=true)");
			createsellerpromotionBean.getPromotionInfo().setIsSpecifyProduct(true);
			createsellerpromotionBean.getPromotionInfo().setIsLimitProduct(false);
			createsellerpromotionCall.callService();
			Logger.verifyEquals("200", createsellerpromotionCall.getString("Code"), "验证Code");
			Logger.verifyEquals("0", createsellerpromotionCall.getString("BCode"), "验证BCode");
			json = createsellerpromotionCall.getJsonObject().getAsJsonObject("Data");
			Logger.verifyEquals(false, json.get("IsSuccess").getAsBoolean(), "验证IsSuccess");
			Logger.verifyIsContains("指定商品与其它促销活动冲突", json.get("Msg").getAsString(), "验证Data.Msg");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P2.class })
	@TestCase
	public void Tc_CreateSellerPromotion_038() {
		Logger.start(true, "创建促销活动指定排除商品后(IsLimitProduct=true),再创建促销活动指定排除商品(IsLimitProduct=true)失败(不能创建2个排除)");
		try {
			Logger.comment("创建(IsLimitProduct=true)");
			JSellerPromotionCallService.CancelOrEndPromotion(1);
			createsellerpromotionBean = initCreateSellerPromotionBean(1, PromotionTypeEnum.ReduceIfCountEnough);
			addPromotionValue(createsellerpromotionBean, "1", "2");
			createsellerpromotionBean.getPromotionInfo().setIsSpecifyProduct(false);
			createsellerpromotionBean.getPromotionInfo().setIsLimitProduct(true);
			List<Map> bpw = new YmtBuyerProductWapper().getLimit(4);
			String pid = bpw.get(0).get("ProductId").toString();
			createsellerpromotionBean.getPromotionInfo().getProductIds().add(pid);
			createsellerpromotionCall.setData(createsellerpromotionBean);
			createsellerpromotionCall.callService();
			Logger.verifyEquals("操作成功", createsellerpromotionCall.getString("Msg"), "验证Msg");
			Logger.verifyEquals("200", createsellerpromotionCall.getString("Code"), "验证Code");
			Logger.verifyEquals("0", createsellerpromotionCall.getString("BCode"), "验证BCode");
			JsonObject json = createsellerpromotionCall.getJsonObject().getAsJsonObject("Data");
			Logger.verifyEquals(true, json.get("IsSuccess").getAsBoolean(), "验证IsSuccess");
			Logger.verifyEquals("无冲突满减促销", json.get("Msg").getAsString(), "验证Data.Msg");
			Integer PromotionId = json.get("PromotionId").getAsInt();
			verifyDB(PromotionId, createsellerpromotionBean);
			
			Logger.comment("再次创建(IsLimitProduct=true)");
			
			pid = bpw.get(1).get("ProductId").toString();
			createsellerpromotionBean.getPromotionInfo().getProductIds().clear();
			createsellerpromotionBean.getPromotionInfo().getProductIds().add(pid);
			createsellerpromotionCall.setData(createsellerpromotionBean);
			createsellerpromotionCall.callService();
			Logger.verifyEquals("200", createsellerpromotionCall.getString("Code"), "验证Code");
			Logger.verifyEquals("0", createsellerpromotionCall.getString("BCode"), "验证BCode");
			json = createsellerpromotionCall.getJsonObject().getAsJsonObject("Data");
			Logger.verifyEquals(false, json.get("IsSuccess").getAsBoolean(), "验证IsSuccess");
			Logger.verifyEquals("已经创建过排除部分商品促销活动", json.get("Msg").getAsString(), "验证Data.Msg");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P2.class })
	@TestCase
	public void Tc_CreateSellerPromotion_039() {
		Logger.start(true, "创建此商品的指定促销活动成功(IsSpecifyProduct为true)后,创建促销活动指定排除商品后(IsLimitProduct=true)商品包含指定商品,成功");
		try {
			Logger.comment("创建(IsSpecifyProduct=true)");
			JSellerPromotionCallService.CancelOrEndPromotion(1);
			createsellerpromotionBean = initCreateSellerPromotionBean(1, PromotionTypeEnum.ReduceIfCountEnough);
			addPromotionValue(createsellerpromotionBean, "1", "2");
			createsellerpromotionBean.getPromotionInfo().setIsSpecifyProduct(true);
			createsellerpromotionBean.getPromotionInfo().setIsLimitProduct(false);
			List<Map> bpw = new YmtBuyerProductWapper().getLimit(4);
			String pid = bpw.get(0).get("ProductId").toString();
			createsellerpromotionBean.getPromotionInfo().getProductIds().add(pid);
			createsellerpromotionCall.setData(createsellerpromotionBean);
			createsellerpromotionCall.callService();
			Logger.verifyEquals("操作成功", createsellerpromotionCall.getString("Msg"), "验证Msg");
			Logger.verifyEquals("200", createsellerpromotionCall.getString("Code"), "验证Code");
			Logger.verifyEquals("0", createsellerpromotionCall.getString("BCode"), "验证BCode");
			JsonObject json = createsellerpromotionCall.getJsonObject().getAsJsonObject("Data");
			Logger.verifyEquals(true, json.get("IsSuccess").getAsBoolean(), "验证IsSuccess");
			Logger.verifyEquals("无冲突满减促销", json.get("Msg").getAsString(), "验证Data.Msg");
			Integer PromotionId = json.get("PromotionId").getAsInt();
			verifyDB(PromotionId, createsellerpromotionBean);
			
			Logger.comment("创建(IsLimitProduct=true)");
			createsellerpromotionBean.getPromotionInfo().setIsSpecifyProduct(false);
			createsellerpromotionBean.getPromotionInfo().setIsLimitProduct(true);
			createsellerpromotionCall.setData(createsellerpromotionBean);
			createsellerpromotionCall.callService();
			Logger.verifyEquals("操作成功", createsellerpromotionCall.getString("Msg"), "验证Msg");
			Logger.verifyEquals("200", createsellerpromotionCall.getString("Code"), "验证Code");
			Logger.verifyEquals("0", createsellerpromotionCall.getString("BCode"), "验证BCode");
			json = createsellerpromotionCall.getJsonObject().getAsJsonObject("Data");
			Logger.verifyEquals(true, json.get("IsSuccess").getAsBoolean(), "验证IsSuccess");
			Logger.verifyEquals("无冲突满减促销", json.get("Msg").getAsString(), "验证Data.Msg");
			PromotionId = json.get("PromotionId").getAsInt();
			verifyDB(PromotionId, createsellerpromotionBean);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P2.class })
	@TestCase
	public void Tc_CreateSellerPromotion_040() {
		Logger.start(true, "创建此商品的指定促销活动成功(IsSpecifyProduct为true)2次后,创建促销活动指定排除商品后(IsLimitProduct=true)商品包含全部指定商品,成功");
		try {
			Logger.comment("创建(IsSpecifyProduct=true)");
			JSellerPromotionCallService.CancelOrEndPromotion(1);
			createsellerpromotionBean = initCreateSellerPromotionBean(1, PromotionTypeEnum.ReduceIfCountEnough);
			addPromotionValue(createsellerpromotionBean, "1", "2");
			createsellerpromotionBean.getPromotionInfo().setIsSpecifyProduct(true);
			createsellerpromotionBean.getPromotionInfo().setIsLimitProduct(false);
			List<Map> bpw = new YmtBuyerProductWapper().getLimit(4);
			String pid = bpw.get(0).get("ProductId").toString();
			createsellerpromotionBean.getPromotionInfo().getProductIds().add(pid);
			createsellerpromotionCall.setData(createsellerpromotionBean);
			createsellerpromotionCall.callService();
			Logger.verifyEquals("操作成功", createsellerpromotionCall.getString("Msg"), "验证Msg");
			Logger.verifyEquals("200", createsellerpromotionCall.getString("Code"), "验证Code");
			Logger.verifyEquals("0", createsellerpromotionCall.getString("BCode"), "验证BCode");
			JsonObject json = createsellerpromotionCall.getJsonObject().getAsJsonObject("Data");
			Logger.verifyEquals(true, json.get("IsSuccess").getAsBoolean(), "验证IsSuccess");
			Logger.verifyEquals("无冲突满减促销", json.get("Msg").getAsString(), "验证Data.Msg");
			Integer PromotionId = json.get("PromotionId").getAsInt();
			verifyDB(PromotionId, createsellerpromotionBean);
			
			Logger.comment("第二次创建(IsSpecifyProduct=true)");
			createsellerpromotionBean.getPromotionInfo().getProductIds().clear();
			 pid = bpw.get(1).get("ProductId").toString();
			createsellerpromotionBean.getPromotionInfo().getProductIds().add(pid);
			createsellerpromotionCall.setData(createsellerpromotionBean);
			createsellerpromotionCall.callService();
			Logger.verifyEquals("操作成功", createsellerpromotionCall.getString("Msg"), "验证Msg");
			Logger.verifyEquals("200", createsellerpromotionCall.getString("Code"), "验证Code");
			Logger.verifyEquals("0", createsellerpromotionCall.getString("BCode"), "验证BCode");
			json = createsellerpromotionCall.getJsonObject().getAsJsonObject("Data");
			Logger.verifyEquals(true, json.get("IsSuccess").getAsBoolean(), "验证IsSuccess");
			Logger.verifyEquals("无冲突满减促销", json.get("Msg").getAsString(), "验证Data.Msg");
			PromotionId = json.get("PromotionId").getAsInt();
			verifyDB(PromotionId, createsellerpromotionBean);
			
			
			Logger.comment("创建(IsLimitProduct=true),包含上面2个商品");
			createsellerpromotionBean.getPromotionInfo().setIsSpecifyProduct(false);
			createsellerpromotionBean.getPromotionInfo().setIsLimitProduct(true);
			
			createsellerpromotionBean.getPromotionInfo().getProductIds().clear();
			for (Map map : bpw) {
				createsellerpromotionBean.getPromotionInfo().getProductIds().add(map.get("ProductId").toString());
			}
//			createsellerpromotionBean.getPromotionInfo().getProductIds().add(bpw.get(0).get("ProductId").toString());
//			createsellerpromotionBean.getPromotionInfo().getProductIds().add(bpw.get(1).get("ProductId").toString());
			createsellerpromotionCall.setData(createsellerpromotionBean);
			createsellerpromotionCall.callService();
			Logger.verifyEquals("操作成功", createsellerpromotionCall.getString("Msg"), "验证Msg");
			Logger.verifyEquals("200", createsellerpromotionCall.getString("Code"), "验证Code");
			Logger.verifyEquals("0", createsellerpromotionCall.getString("BCode"), "验证BCode");
			json = createsellerpromotionCall.getJsonObject().getAsJsonObject("Data");
			Logger.verifyEquals(true, json.get("IsSuccess").getAsBoolean(), "验证IsSuccess");
			Logger.verifyEquals("无冲突满减促销", json.get("Msg").getAsString(), "验证Data.Msg");
			PromotionId = json.get("PromotionId").getAsInt();
			verifyDB(PromotionId, createsellerpromotionBean);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P2.class })
	@TestCase
	public void Tc_CreateSellerPromotion_041() {
		Logger.start(true, "创建此商品的指定促销活动成功(IsSpecifyProduct为true)后,创建创建促销活动指定排除商品后(IsLimitProduct=true)商品不完全包含指定商品,失败");
		try {
			Logger.comment("创建(IsSpecifyProduct=true)");
			JSellerPromotionCallService.CancelOrEndPromotion(41);
			createsellerpromotionBean = initCreateSellerPromotionBean(41, PromotionTypeEnum.ReduceIfCountEnough);
			addPromotionValue(createsellerpromotionBean, "1", "2");
			createsellerpromotionBean.getPromotionInfo().setIsSpecifyProduct(true);
			createsellerpromotionBean.getPromotionInfo().setIsLimitProduct(false);
			List<Map> bpw = new YmtBuyerProductWapper().getLimit(4);
			String pid = bpw.get(0).get("ProductId").toString();
			createsellerpromotionBean.getPromotionInfo().getProductIds().add(pid);
			createsellerpromotionCall.setData(createsellerpromotionBean);
			createsellerpromotionCall.callService();
			Logger.verifyEquals("操作成功", createsellerpromotionCall.getString("Msg"), "验证Msg");
			Logger.verifyEquals("200", createsellerpromotionCall.getString("Code"), "验证Code");
			Logger.verifyEquals("0", createsellerpromotionCall.getString("BCode"), "验证BCode");
			JsonObject json = createsellerpromotionCall.getJsonObject().getAsJsonObject("Data");
			Logger.verifyEquals(true, json.get("IsSuccess").getAsBoolean(), "验证IsSuccess");
			Logger.verifyEquals("无冲突满减促销", json.get("Msg").getAsString(), "验证Data.Msg");
			Integer PromotionId = json.get("PromotionId").getAsInt();
			verifyDB(PromotionId, createsellerpromotionBean);
			
			Logger.comment("第二次创建(IsSpecifyProduct=true)");
			createsellerpromotionBean.getPromotionInfo().getProductIds().clear();
			 pid = bpw.get(1).get("ProductId").toString();
			createsellerpromotionBean.getPromotionInfo().getProductIds().add(pid);
			createsellerpromotionCall.setData(createsellerpromotionBean);
			createsellerpromotionCall.callService();
			Logger.verifyEquals("操作成功", createsellerpromotionCall.getString("Msg"), "验证Msg");
			Logger.verifyEquals("200", createsellerpromotionCall.getString("Code"), "验证Code");
			Logger.verifyEquals("0", createsellerpromotionCall.getString("BCode"), "验证BCode");
			json = createsellerpromotionCall.getJsonObject().getAsJsonObject("Data");
			Logger.verifyEquals(true, json.get("IsSuccess").getAsBoolean(), "验证IsSuccess");
			Logger.verifyEquals("无冲突满减促销", json.get("Msg").getAsString(), "验证Data.Msg");
			PromotionId = json.get("PromotionId").getAsInt();
			verifyDB(PromotionId, createsellerpromotionBean);
			
			
			Logger.comment("创建(IsLimitProduct=true),包含上面2个商品");
			createsellerpromotionBean.getPromotionInfo().setIsSpecifyProduct(false);
			createsellerpromotionBean.getPromotionInfo().setIsLimitProduct(true);
			
			createsellerpromotionBean.getPromotionInfo().getProductIds().clear();
			createsellerpromotionBean.getPromotionInfo().getProductIds().add(bpw.get(0).get("ProductId").toString());
//			createsellerpromotionBean.getPromotionInfo().getProductIds().add(bpw.get(1).get("ProductId").toString());
			createsellerpromotionCall.setData(createsellerpromotionBean);
			createsellerpromotionCall.callService();
			Logger.verifyEquals("200", createsellerpromotionCall.getString("Code"), "验证Code");
			Logger.verifyEquals("0", createsellerpromotionCall.getString("BCode"), "验证BCode");
			json = createsellerpromotionCall.getJsonObject().getAsJsonObject("Data");
			Logger.verifyEquals(false, json.get("IsSuccess").getAsBoolean(), "验证IsSuccess");
			Logger.verifyIsContains("排除商品与其它促销活动冲突", json.get("Msg").getAsString(), "验证Data.Msg");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P2.class })
	@TestCase
	public void Tc_CreateSellerPromotion_042() {
		Logger.start(true, "重复创建满件减PromotionType1指定商品,IsSpecifyProduct为true后再创建创建满额减PromotionType3,ProductIds同一个重复调用,失败cp21");
		try {
			JSellerPromotionCallService.CancelOrEndPromotion(2);
			createsellerpromotionBean = initCreateSellerPromotionBean(2, PromotionTypeEnum.ReduceIfCountEnough);
			createsellerpromotionBean.getPromotionInfo().setIsSpecifyProduct(true);
			createsellerpromotionBean.getPromotionInfo().setIsLimitProduct(false);
			addPromotionValue(createsellerpromotionBean, "10", "2");
			List<Map> bpw = new YmtBuyerProductWapper().getLimit(2);
			String pid = bpw.get(0).get("ProductId").toString();
			createsellerpromotionBean.getPromotionInfo().getProductIds().add(pid);
			createsellerpromotionCall.setData(createsellerpromotionBean);
			createsellerpromotionCall.callService();

			Logger.verifyEquals("操作成功", createsellerpromotionCall.getString("Msg"), "验证Msg");
			Logger.verifyEquals("200", createsellerpromotionCall.getString("Code"), "验证Code");
			Logger.verifyEquals("0", createsellerpromotionCall.getString("BCode"), "验证BCode");
			JsonObject json = createsellerpromotionCall.getJsonObject().getAsJsonObject("Data");
			Logger.verifyEquals(true, json.get("IsSuccess").getAsBoolean(), "验证IsSuccess");
			Logger.verifyEquals("无冲突满减促销", json.get("Msg").getAsString(), "验证Data.Msg");
			Integer PromotionId = json.get("PromotionId").getAsInt();
			verifyDB(PromotionId, createsellerpromotionBean);

			createsellerpromotionBean = initCreateSellerPromotionBean(2, PromotionTypeEnum.ReduceIfAmountEnough);
			createsellerpromotionBean.getPromotionInfo().getProductIds().add(pid);
			createsellerpromotionCall.callService();
			Logger.verifyEquals("200", createsellerpromotionCall.getString("Code"), "验证Code");
			Logger.verifyEquals("0", createsellerpromotionCall.getString("BCode"), "验证BCode");
			json = createsellerpromotionCall.getJsonObject().getAsJsonObject("Data");
			Logger.verifyEquals(false, json.get("IsSuccess").getAsBoolean(), "验证IsSuccess");
			Logger.verifyIsContains("指定商品与其它促销活动冲突", json.get("Msg").getAsString(), "验证Data.Msg");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P2.class })
	@TestCase
	public void Tc_CreateSellerPromotion_043() {
		Logger.start(true, "创建促销活动指定排除商品后(IsLimitProduct=true),提前结束此活动,在创建指定促销活动成功(IsSpecifyProduct为true)包含不存之前排除中商品,成功");
		try {
			Logger.comment("创建(IsLimitProduct=true)");
			JSellerPromotionCallService.CancelOrEndPromotion(1);
			createsellerpromotionBean = initCreateSellerPromotionBean(1, PromotionTypeEnum.ReduceIfCountEnough);
			addPromotionValue(createsellerpromotionBean, "1", "2");
			createsellerpromotionBean.getPromotionInfo().setIsSpecifyProduct(false);
			createsellerpromotionBean.getPromotionInfo().setIsLimitProduct(true);
			List<Map> bpw = new YmtBuyerProductWapper().getLimit(4);
			String pid = bpw.get(0).get("ProductId").toString();
			createsellerpromotionBean.getPromotionInfo().getProductIds().add(pid);
			createsellerpromotionCall.setData(createsellerpromotionBean);
			createsellerpromotionCall.callService();
			Logger.verifyEquals("操作成功", createsellerpromotionCall.getString("Msg"), "验证Msg");
			Logger.verifyEquals("200", createsellerpromotionCall.getString("Code"), "验证Code");
			Logger.verifyEquals("0", createsellerpromotionCall.getString("BCode"), "验证BCode");
			JsonObject json = createsellerpromotionCall.getJsonObject().getAsJsonObject("Data");
			Logger.verifyEquals(true, json.get("IsSuccess").getAsBoolean(), "验证IsSuccess");
			Logger.verifyEquals("无冲突满减促销", json.get("Msg").getAsString(), "验证Data.Msg");
			Integer PromotionId = json.get("PromotionId").getAsInt();
			verifyDB(PromotionId, createsellerpromotionBean);
			
			JSellerPromotionCallService.CancelOrEndPromotion(1);
			createsellerpromotionCall.callService();
			Logger.verifyEquals("操作成功", createsellerpromotionCall.getString("Msg"), "验证Msg");
			Logger.verifyEquals("200", createsellerpromotionCall.getString("Code"), "验证Code");
			Logger.verifyEquals("0", createsellerpromotionCall.getString("BCode"), "验证BCode");
			 json = createsellerpromotionCall.getJsonObject().getAsJsonObject("Data");
			Logger.verifyEquals(true, json.get("IsSuccess").getAsBoolean(), "验证IsSuccess");
			Logger.verifyEquals("无冲突满减促销", json.get("Msg").getAsString(), "验证Data.Msg");
			 PromotionId = json.get("PromotionId").getAsInt();
			verifyDB(PromotionId, createsellerpromotionBean);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({ P2.class })
	@TestCase
	public void Tc_CreateSellerPromotion_044() {
		Logger.start(true, "创建满件减PromotionType1，规则(IsSpecifyProduct为true,ProductIds不同但是value相同)重复失败cp28");
		try {
			JSellerPromotionCallService.CancelOrEndPromotion(2);
			createsellerpromotionBean = initCreateSellerPromotionBean(2, PromotionTypeEnum.ReduceIfCountEnough);
			createsellerpromotionBean.getPromotionInfo().setIsSpecifyProduct(true);
			createsellerpromotionBean.getPromotionInfo().setIsLimitProduct(false);
			addPromotionValue(createsellerpromotionBean, "10", "2");
			addPromotionValue(createsellerpromotionBean, "20", "2");
			List<Map> bpw = new YmtBuyerProductWapper().getLimit(2);
			String pid = bpw.get(0).get("ProductId").toString();
			String pid2 = bpw.get(1).get("ProductId").toString();
			createsellerpromotionBean.getPromotionInfo().getProductIds().add(pid);
			createsellerpromotionBean.getPromotionInfo().getProductIds().add(pid2);
			createsellerpromotionCall.setData(createsellerpromotionBean);
			createsellerpromotionCall.callService();

			Logger.verifyIsContains("促销优惠（金额/折扣）有重复", createsellerpromotionCall.getString("Msg"), "验证Msg");
			Logger.verifyEquals("400", createsellerpromotionCall.getString("Code"), "验证Code");
			Logger.verifyEquals("-1", createsellerpromotionCall.getString("BCode"), "验证BCode");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({ P2.class })
	@TestCase
	public void Tc_CreateSellerPromotion_045() {
		Logger.start(true, "创建此商品的指定促销活动成功(IsSpecifyProduct为true)2次后,创建促销活动指定排除商品后(IsLimitProduct=true)商品正好是全部指定商品,成功cp40");
		try {
			Logger.comment("创建(IsSpecifyProduct=true)");
			JSellerPromotionCallService.CancelOrEndPromotion(1);
			createsellerpromotionBean = initCreateSellerPromotionBean(1, PromotionTypeEnum.ReduceIfCountEnough);
			addPromotionValue(createsellerpromotionBean, "1", "2");
			createsellerpromotionBean.getPromotionInfo().setIsSpecifyProduct(true);
			createsellerpromotionBean.getPromotionInfo().setIsLimitProduct(false);
			List<Map> bpw = new YmtBuyerProductWapper().getLimit(4);
			String pid = bpw.get(0).get("ProductId").toString();
			createsellerpromotionBean.getPromotionInfo().getProductIds().add(pid);
			createsellerpromotionCall.setData(createsellerpromotionBean);
			createsellerpromotionCall.callService();
			Logger.verifyEquals("操作成功", createsellerpromotionCall.getString("Msg"), "验证Msg");
			Logger.verifyEquals("200", createsellerpromotionCall.getString("Code"), "验证Code");
			Logger.verifyEquals("0", createsellerpromotionCall.getString("BCode"), "验证BCode");
			JsonObject json = createsellerpromotionCall.getJsonObject().getAsJsonObject("Data");
			Logger.verifyEquals(true, json.get("IsSuccess").getAsBoolean(), "验证IsSuccess");
			Logger.verifyEquals("无冲突满减促销", json.get("Msg").getAsString(), "验证Data.Msg");
			Integer PromotionId = json.get("PromotionId").getAsInt();
			verifyDB(PromotionId, createsellerpromotionBean);
			
			Logger.comment("第二次创建(IsSpecifyProduct=true)");
			createsellerpromotionBean.getPromotionInfo().getProductIds().clear();
			 pid = bpw.get(1).get("ProductId").toString();
			createsellerpromotionBean.getPromotionInfo().getProductIds().add(pid);
			createsellerpromotionCall.setData(createsellerpromotionBean);
			createsellerpromotionCall.callService();
			Logger.verifyEquals("操作成功", createsellerpromotionCall.getString("Msg"), "验证Msg");
			Logger.verifyEquals("200", createsellerpromotionCall.getString("Code"), "验证Code");
			Logger.verifyEquals("0", createsellerpromotionCall.getString("BCode"), "验证BCode");
			json = createsellerpromotionCall.getJsonObject().getAsJsonObject("Data");
			Logger.verifyEquals(true, json.get("IsSuccess").getAsBoolean(), "验证IsSuccess");
			Logger.verifyEquals("无冲突满减促销", json.get("Msg").getAsString(), "验证Data.Msg");
			PromotionId = json.get("PromotionId").getAsInt();
			verifyDB(PromotionId, createsellerpromotionBean);
			
			
			Logger.comment("创建(IsLimitProduct=true),正好是上面2个商品");
			createsellerpromotionBean.getPromotionInfo().setIsSpecifyProduct(false);
			createsellerpromotionBean.getPromotionInfo().setIsLimitProduct(true);
			
			createsellerpromotionBean.getPromotionInfo().getProductIds().clear();
//			for (Map map : bpw) {
//				createsellerpromotionBean.getPromotionInfo().getProductIds().add(bpw.get(0).get("ProductId").toString());
//			}
			createsellerpromotionBean.getPromotionInfo().getProductIds().add(bpw.get(0).get("ProductId").toString());
			createsellerpromotionBean.getPromotionInfo().getProductIds().add(bpw.get(1).get("ProductId").toString());
			createsellerpromotionCall.setData(createsellerpromotionBean);
			createsellerpromotionCall.callService();
			Logger.verifyEquals("操作成功", createsellerpromotionCall.getString("Msg"), "验证Msg");
			Logger.verifyEquals("200", createsellerpromotionCall.getString("Code"), "验证Code");
			Logger.verifyEquals("0", createsellerpromotionCall.getString("BCode"), "验证BCode");
			json = createsellerpromotionCall.getJsonObject().getAsJsonObject("Data");
			Logger.verifyEquals(true, json.get("IsSuccess").getAsBoolean(), "验证IsSuccess");
			Logger.verifyEquals("无冲突满减促销", json.get("Msg").getAsString(), "验证Data.Msg");
			PromotionId = json.get("PromotionId").getAsInt();
			verifyDB(PromotionId, createsellerpromotionBean);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({ P2.class })
	@TestCase
	public void Tc_CreateSellerPromotion_046() {
		Logger.start(true, "创建(IsSpecifyProduct=true)但productid重复,自动排重成功");
		try {
			Logger.comment("创建(IsSpecifyProduct=true)");
			JSellerPromotionCallService.CancelOrEndPromotion(1);
			createsellerpromotionBean = initCreateSellerPromotionBean(1, PromotionTypeEnum.ReduceIfCountEnough);
			addPromotionValue(createsellerpromotionBean, "1", "2");
			createsellerpromotionBean.getPromotionInfo().setIsSpecifyProduct(true);
			createsellerpromotionBean.getPromotionInfo().setIsLimitProduct(false);
			List<Map> bpw = new YmtBuyerProductWapper().getLimit(4);
			createsellerpromotionBean.getPromotionInfo().getProductIds().add(bpw.get(0).get("ProductId").toString());
			createsellerpromotionBean.getPromotionInfo().getProductIds().add(bpw.get(0).get("ProductId").toString());
			createsellerpromotionBean.getPromotionInfo().getProductIds().add(bpw.get(1).get("ProductId").toString());
			createsellerpromotionCall.setData(createsellerpromotionBean);
			createsellerpromotionCall.callService();
			Logger.verifyEquals("200", createsellerpromotionCall.getString("Code"), "验证Code");
			Logger.verifyEquals("0", createsellerpromotionCall.getString("BCode"), "验证BCode");
			JsonObject json = createsellerpromotionCall.getJsonObject().getAsJsonObject("Data");
			Logger.verifyEquals(true, json.get("IsSuccess").getAsBoolean(), "验证IsSuccess");
			Logger.verifyEquals("无冲突满减促销", json.get("Msg").getAsString(), "验证Data.Msg");
			int PromotionId = json.get("PromotionId").getAsInt();
			verifyDB(PromotionId, createsellerpromotionBean);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({ P2.class })
	@TestCase
	public void Tc_CreateSellerPromotion_047() {
		Logger.start(true, "同一买手不同时间段创建活动超过MaxCreatePromotionCount(disconf:def3),成功cp34");
		try {
			JSellerPromotionCallService.CancelOrEndPromotion(2);
			createsellerpromotionBean = initCreateSellerPromotionBean(2, PromotionTypeEnum.ReduceIfCountEnough);
			createsellerpromotionBean.getPromotionInfo().setIsSpecifyProduct(true);
			createsellerpromotionBean.getPromotionInfo().setIsLimitProduct(false);
			addPromotionValue(createsellerpromotionBean, "10", "2");
			List<Map> bpw = new YmtBuyerProductWapper().getLimit(4);
			String pid = bpw.get(0).get("ProductId").toString();
			createsellerpromotionBean.getPromotionInfo().getProductIds().add(pid);
			createsellerpromotionCall.setData(createsellerpromotionBean);
			createsellerpromotionCall.callService();

			Logger.verifyEquals("操作成功", createsellerpromotionCall.getString("Msg"), "验证Msg");
			Logger.verifyEquals("200", createsellerpromotionCall.getString("Code"), "验证Code");
			Logger.verifyEquals("0", createsellerpromotionCall.getString("BCode"), "验证BCode");
			JsonObject json = createsellerpromotionCall.getJsonObject().getAsJsonObject("Data");
			Logger.verifyEquals(true, json.get("IsSuccess").getAsBoolean(), "验证IsSuccess");
			Logger.verifyEquals("无冲突满减促销", json.get("Msg").getAsString(), "验证Data.Msg");
			Integer PromotionId = json.get("PromotionId").getAsInt();
			verifyDB(PromotionId, createsellerpromotionBean);

			Logger.comment("创建第二个活动");
			createsellerpromotionCall=new CreateSellerPromotionCall();
			pid = bpw.get(1).get("ProductId").toString();
			createsellerpromotionBean.getPromotionInfo().getProductIds().clear();
			createsellerpromotionBean.getPromotionInfo().getProductIds().add(pid);
			createsellerpromotionCall.setData(createsellerpromotionBean);
			createsellerpromotionCall.callService();
			Logger.verifyEquals("操作成功", createsellerpromotionCall.getString("Msg"), "验证Msg");
			Logger.verifyEquals("200", createsellerpromotionCall.getString("Code"), "验证Code");
			Logger.verifyEquals("0", createsellerpromotionCall.getString("BCode"), "验证BCode");
			json = createsellerpromotionCall.getJsonObject().getAsJsonObject("Data");
			Logger.verifyEquals(true, json.get("IsSuccess").getAsBoolean(), "验证IsSuccess");
			Logger.verifyEquals("无冲突满减促销", json.get("Msg").getAsString(), "验证Data.Msg");
			PromotionId = json.get("PromotionId").getAsInt();
			verifyDB(PromotionId, createsellerpromotionBean);
			
			Logger.comment("创建第三个活动");
			createsellerpromotionCall=new CreateSellerPromotionCall();
			pid = bpw.get(2).get("ProductId").toString();
			createsellerpromotionBean.getPromotionInfo().getProductIds().clear();
			createsellerpromotionBean.getPromotionInfo().getProductIds().add(pid);
			createsellerpromotionCall.setData(createsellerpromotionBean);
			createsellerpromotionCall.callService();
			Logger.verifyEquals("操作成功", createsellerpromotionCall.getString("Msg"), "验证Msg");
			Logger.verifyEquals("200", createsellerpromotionCall.getString("Code"), "验证Code");
			Logger.verifyEquals("0", createsellerpromotionCall.getString("BCode"), "验证BCode");
			json = createsellerpromotionCall.getJsonObject().getAsJsonObject("Data");
			Logger.verifyEquals(true, json.get("IsSuccess").getAsBoolean(), "验证IsSuccess");
			Logger.verifyEquals("无冲突满减促销", json.get("Msg").getAsString(), "验证Data.Msg");
			PromotionId = json.get("PromotionId").getAsInt();
			verifyDB(PromotionId, createsellerpromotionBean);
			
			Logger.comment("创建第四个活动");
			createsellerpromotionCall=new CreateSellerPromotionCall();
			pid = bpw.get(3).get("ProductId").toString();
			createsellerpromotionBean.getPromotionInfo().getProductIds().clear();
			createsellerpromotionBean.getPromotionInfo().getProductIds().add(pid);
			createsellerpromotionBean.getPromotionInfo().setPromotionBeginTime(YMTDateUtil.getBeforeOrNextDay(3, YMTDateUtil.YMDTHMS_STRING));
			createsellerpromotionBean.getPromotionInfo().setPromotionEndTime(YMTDateUtil.getBeforeOrNextDay(4, YMTDateUtil.YMDTHMS_STRING));
			createsellerpromotionCall.setData(createsellerpromotionBean);
			createsellerpromotionCall.callService();
			Logger.verifyEquals("200", createsellerpromotionCall.getString("Code"), "验证Code");
			Logger.verifyEquals("0", createsellerpromotionCall.getString("BCode"), "验证BCode");

			json = createsellerpromotionCall.getJsonObject().getAsJsonObject("Data");
			Logger.verifyEquals(true, json.get("IsSuccess").getAsBoolean(), "验证IsSuccess");
			Logger.verifyEquals("无冲突满减促销", json.get("Msg").getAsString(), "验证Data.Msg");
			PromotionId = json.get("PromotionId").getAsInt();
			verifyDB(PromotionId, createsellerpromotionBean);
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
//	@Test
//	@Category({ P2.class })
//	@TestCase
//	public void Tc_CreateSellerPromotion_047() {
//		Logger.start(true, "创建(IsLimitProduct=true)但productid重复,失败");
//		try {
//			Logger.comment("创建(IsSpecifyProduct=true)");
//			JSellerPromotionCallService.CancelOrEndPromotion(1);
//			createsellerpromotionBean = initCreateSellerPromotionBean(1, PromotionTypeEnum.ReduceIfCountEnough);
//			addPromotionValue(createsellerpromotionBean, "1", "2");
//			createsellerpromotionBean.getPromotionInfo().setIsSpecifyProduct(false);
//			createsellerpromotionBean.getPromotionInfo().setIsLimitProduct(true);
//			List<Map> bpw = new YmtBuyerProductWapper().getLimit(4);
//
//			createsellerpromotionBean.getPromotionInfo().getProductIds().add(bpw.get(0).get("ProductId").toString());
//			createsellerpromotionBean.getPromotionInfo().getProductIds().add(bpw.get(0).get("ProductId").toString());
//			createsellerpromotionBean.getPromotionInfo().getProductIds().add(bpw.get(1).get("ProductId").toString());
//			createsellerpromotionCall.setData(createsellerpromotionBean);
//			createsellerpromotionCall.callService();
//			Logger.verifyEquals("200", createsellerpromotionCall.getString("Code"), "验证Code");
//			Logger.verifyEquals("0", createsellerpromotionCall.getString("BCode"), "验证BCode");
//			JsonObject json = createsellerpromotionCall.getJsonObject().getAsJsonObject("Data");
//			Logger.verifyEquals(false, json.get("IsSuccess").getAsBoolean(), "验证IsSuccess");
//			Logger.verifyIsContains("重复", json.get("Msg").getAsString(), "验证Data.Msg");
//
//		} catch (Exception e) {
//			Logger.fail(e);
//		}
//	}
}